/*
 * -------------------------------------------------------------------------------------------------
 *                            COPYRIGHT(C) BOCO HEALTH 2016
 * -------------------------------------------------------------------------------------------------
 *
 * =================================================================================================
 *  HISTORY
 *
 *      Tag                Date            Author           Description
 * =================================================================================================
 *      created            2016/11/17      lizhineng        create
 * =================================================================================================
 *
 */

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
==================================================================================
 * HISTORY
 *
 * Tag                      Date       Author           Description
 * ======================== ========== ===============  ==========================
 *       created            2016/08/17   lizhineng      容器，存放activity，便于销毁
 *
==================================================================================
 */
package com.boco.base.utils;

import android.app.Activity;

import java.util.LinkedList;
import java.util.List;

public class ActivityCache {
    private static List<Activity> list = new LinkedList<>();

    /**
     * 添加到activity容器中
     *
     * @param activity
     */
    public static void putActivity(Activity activity) {
        list.add(activity);
    }

    /**
     * 便利所有的activity并finish
     */
    public static void finishActivity() {
        for (Activity activity : list) {
            activity.finish();
        }
    }
}
